package com.github.dongglin.smart.spring.boot.plus.core.framework.pager;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Schema(description = "分页返回信息")
public class PageResult<T> implements Serializable {
    private static final long serialVersionUID = -8325346069801679140L;
    /**
     * 数据
     */
    @Schema(description = "返回数据集")
    private List<T> records = Collections.emptyList();

    /**
     * 当前页码
     */
    @Schema(description = "当前页码")
    private int page;

    /**
     * 分页大小
     */
    @Schema(description = "分页大小")
    private long pageSize;

    /**
     * 总数
     */
    @Schema(description = "数据总数")
    private long total;
    /**
     * 总页数
     */
    @Schema(description = "总页数")
    private long pages;
}
